package com.hsgene.order.constants.v1;

/**
 * 支付业务类型定义
 *
 * @author wangbing
 * @version 1.0, 2018/9/29
 */
public enum PaymentBusinessType {

    /**
     * 业务类型枚举
     */
    GENETIC_TESTING(1, "基因检测"),

    GENETIC_TESTING_ADDITION(2, "基因检测补款"),

    UNDEFINED(99, "undefined");

    private final int code;

    private final String desc;

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    PaymentBusinessType(int code, String desc) {

        this.code = code;
        this.desc = desc;
    }

    public static PaymentBusinessType getEnum(int code) {
        for (PaymentBusinessType type : values()) {
            if (type.code == code) {
                return type;
            }
        }

        return UNDEFINED;
    }
}
